<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="$!webPath/resources/style/system/manage/$!{config.websiteCss}/template.css"  rel="stylesheet" type="text/css"/>
<link href="$!webPath/resources/style/common/css/overlay.css" type="text/css" rel="stylesheet" />
<script src="$!webPath/resources/js/jquery-1.8.3.min.js"></script>
<script src="$!webPath/resources/js/jquery-ui-1.8.21.js"></script>
<script src="$!webPath/resources/js/jquery.validate.min.js"></script>
<script src="$!webPath/resources/js/jquery.shop.common.js"></script>
<script src="$!webPath/resources/js/jquery.poshytip.min.js"></script>
<script>
jQuery(document).ready(function(){
  jQuery("#theForm").validate({
    rules:{
	  userName:{
	    required :true
	  },
	  integral:{required:true,digits:true,min:1},
	  content:{required:true}
	 },
	messages:{
	  userName:{required:"会员名不能为空"},
	  integral:{required:"积分值不能为空",digits:"积分值只能为正整数",min:"积分值不能小于1"},
	  content:{required:"积分说明不能为空"}
	}
  });	
});
function verify_user_integral(){
  var userName=jQuery("#userName").val();
  if(userName!=""){
    jQuery.post("$!webPath/admin/verify_user_integral.htm",{"userName":userName},function(data){
       if(data!="-1"){
	     jQuery("#user_integral_info").html("会员"+userName+"当前积分:"+data).show();
	   }else{
	     jQuery("#userName").val("");
		 jQuery("#user_integral_info").html("").hide();
	     alert("无此会员信息！");
	   }
    },"text")
  }else{
    jQuery("#user_integral_info").html("").hide();
  }
}
function saveForm(method){
   jQuery("#theForm").submit();
}
</script>
</head>
<body>
<div class="cont">
  <h1 class="seth1">积分管理</h1>
  <div class="settab"><span class="tab-one"></span> <span class="tabs"> <a href="$!webPath/admin/user_integral.htm" class="this">管理</a></span> <span class="tab-two"></span></div>
  <form name="theForm" id="theForm" action="$!webPath/admin/user_integral_save.htm" method=post>
    <input name="currentPage" type="hidden" id="currentPage" value="$!currentPage" />
    <input name="list_url" type="hidden" id="list_url" value="$!webPath/admin/user_integral.htm" />
    <input name="add_url" type="hidden" id="add_url" value="$!webPath/admin/article_add.htm" />
    <div class="setcont">
      <ul class="set1">
        <li><strong class="orange fontsize20">*</strong>会员名</li>
		<li id="user_integral_info" style="display:none;"></li>
        <li><span class="webname">
          <input name="userName" type="text" id="userName" size="40" onblur="verify_user_integral();" />
          </span></li>
      </ul>
      <ul class="set1">
        <li>操作类型</li>
        <li><span class="webnamesec sizese">
          <select name="operate_type" id="operate_type">
            <option value="add">增加</option>
            <option value="subtract">减少</option>
          </select>
          </span></li>
      </ul>
      <ul class="set1">
        <li><strong class="orange fontsize20">*</strong>积分值</li>
        <li><span class="webname">
          <input name="integral" type="text" id="integral" size="40" />
          </span></li>
      </ul>
      <ul class="set1">
        <li><strong class="orange fontsize20">*</strong>操作说明</li>
        <li><span class="webname">
          <textarea name="content" cols="40" rows="4" id="content"></textarea>
          </span></li>
      </ul>
    </div>
  </form>
  <div class="submit">
    <input name="save" type="button" value="提交" onclick="saveForm()" />
  </div>
</div>
</body>
</html>
